package com.lanhu.designpattern.decorator;

/**
 * author:zhangzg
 * date:2020/11/11 21:59
 */
public class WeChatDecorator implements LoginService{

    private LoginService loginService;

    public WeChatDecorator(LoginService loginService) {
        this.loginService = loginService;
    }

    @Override
    public String login(String username, String password, String type) {
        System.out.println("------记录日志-------");
        return this.loginService.login(username,password,type);
    }

    //新增微信登陆功能
    public String WeChatLogin(String username, String password, String type){
        if(type == "weChat"){
            System.out.println("weChat登陆");
            System.out.println("weChat:"+username);
            System.out.println("密码:"+password);
            return "Success";
        }
        return "Error!";
    }
}
